<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>个人中心</title>
	<link rel="stylesheet" type="text/css" href="style/top.css" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/footer.css" />
    <link rel="stylesheet" type="text/css" href="style/reglog.css" />
	<link rel="stylesheet" type="text/css" href="style/usercenter.css" />
	
  </head>
  
  <body>
	  <!-- 网页头部 -->
	  <%@include file="template/head.jsp" %>
	  
	  <!-- 网页中部 -->
	  <div class="bd1">
    <div class="bd_left1">
    	<img src="${basePath }/upload/${sessionScope.user.headpic }" width="120" height="120" />
        <div class="liebiao">
        	<ul>
            <li>用户名:${sessionScope.user.username }</li>
            <li>积分：${sessionScope.user.score }</li>
            <li>等级：${sessionScope.user.level }</li>
            <li>注册时间：${sessionScope.user.createdate }</li>
            <li>活跃度：${sessionScope.user.active }</li>
            </ul>
        </div>
	</div>
    <div class="bd_right3">
    	<ul>
        	<li><a href="index.jspx?_method=userchange">修改资料</a></li>
            <li><a href="collection.jspx?_method=findMine">我的收藏</a></li>
            <li><a href="article.jspx?_method=findMine">我的帖子</a></li>
            <li><a href="reply.jspx?_method=findmine">我的回帖</a></li>
            <li><a href="message.jspx?_method=findmine">未读消息</a></li>
        </ul>
    </div>
        <div class="change">
        <c:choose>
        
        <c:when test="${sessionScope.collectionlist != null}">
        	<c:choose>
				<c:when test="${requestScope.size > 0}">
				<c:forEach var="collection" items="${sessionScope.collectionlist}">
					<div class="aritlceitem">
						<span><a href="article.jspx?_method=show&id=${collection.article.id }" style="color:blue">${collection.article.name }</a>　发表于　${collection.article.createdate }　作者：${collection.article.user.username }　收藏时间：${collection.createdate }</span>
					</div>
				</c:forEach>
				<div class="articleitem">
	        		<a href="collection.jspx?_method=findMine&p=1">首页</a>　　
	        		<a href="collection.jspx?_method=findMine&p=${page.currentPage - 1 }">上一页</a>　　
	        		<a href="collection.jspx?_method=findMine&p=${page.currentPage + 1 }">下一页</a>　　
	        		<a href="collection.jspx?_method=findMine&p=${page.totlePages }">尾页</a>　　
        		</div>
				</c:when>
				<c:otherwise>
					<div class="articleitem">
						<h4>您还没有收藏帖子!</h4>
					</div>
				</c:otherwise>        	
        	</c:choose>
        	<c:remove var="collectionlist" scope="session"/>
        </c:when>
        
        
        <c:when test="${sessionScope.alist != null}">
        	<c:choose>
				<c:when test="${requestScope.size > 0}">
				<c:forEach var="article" items="${sessionScope.alist}">
					<div class="aritlceitem">
						<span><a href="article.jspx?_method=show&id=${article.id }" style="color:blue">${article.name }</a>　发表于　${article.createdate }　共有${article.clickNum }人看过　有${article.replyNum }回复</span>
					</div>
				</c:forEach>
				<div class="articleitem">
	        		<a href="article.jspx?_method=findMine&p=1">首页</a>　　
	        		<a href="article.jspx?_method=findMine&p=${page.currentPage - 1 }">上一页</a>　　
	        		<a href="article.jspx?_method=findMine&p=${page.currentPage + 1 }">下一页</a>　　
	        		<a href="article.jspx?_method=findMine&p=${page.totlePages }">尾页</a>　　
	        	</div>
				</c:when>
				<c:otherwise>
					<div class="articleitem">
						<h4>您还没有发表过帖子!</h4>
					</div>
				</c:otherwise>        	
        	</c:choose>
        	<c:remove var="alist" scope="session"/>
        </c:when>
        
        
        <c:when test="${not empty sessionScope.myreplylist}">
        	<c:choose>
        	<c:when test="${requestScope.size > 0}">
        		<c:forEach var="reply" items="${sessionScope.myreplylist}">
        			<div class="aritlceitem">
						<span>您于${reply.createdate }回复了${reply.article.user.username }的帖子：<a href="article.jspx?_method=show&id=${reply.article.id }" style="color:blue">${reply.article.name }</a>:</span><br/>
						<span>${reply.content }</span>
					</div> 
        		</c:forEach>
        		 <div class="articleitem">
	        		<a href="reply.jspx?_method=findmine&p=1">首页</a>　　
	        		<a href="reply.jspx?_method=findmine&p=${page.currentPage - 1 }">上一页</a>　　
	        		<a href="reply.jspx?_method=findmine&p=${page.currentPage + 1 }">下一页</a>　　
	        		<a href="reply.jspx?_method=findmine&p=${page.totlePages }">尾页</a>　　
	        	</div>
        	</c:when>
        	<c:otherwise>
        		<div class="articleitem">
					<h4>您还没有回复过帖子!</h4>
				</div>
        	</c:otherwise>
        	</c:choose>
        <c:remove var="myreplylist" scope="session"/>
        </c:when>
        
        
        <c:when test="${not empty sessionScope.msglist}">
        	<c:choose>
        	<c:when test="${requestScope.size > 0}">
        		<c:forEach var="msg" items="${sessionScope.msglist}">
        			<div class="aritlceitem">
						<span>${msg.createdate } 未读消息：</span><br/>
						<p>${msg.content }</p>
					</div> 
        		</c:forEach>
        		<div class="articleitem">
	        		<a href="message.jspx?_method=findmine&p=1">首页</a>　　
	        		<a href="message.jspx?_method=findmine&p=${page.currentPage - 1 }">上一页</a>　　
	        		<a href="message.jspx?_method=findmine&p=${page.currentPage + 1 }">下一页</a>　　
	        		<a href="message.jspx?_method=findmine&p=${page.totlePages }">尾页</a>　　
	        	</div>
        	</c:when>
        	<c:otherwise>
        		<div class="articleitem">
					<h4>您没有未读消息!</h4>
				</div>
        	</c:otherwise>
        	</c:choose>
        <c:remove var="msglist" scope="session"/>
        </c:when>
        
        </c:choose>
        </div>
</div>
	  
	  <!-- 网页尾部 -->
	  <%@include file="template/footer.jsp" %>
  </body>
</html>
